<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>工器具日常检查</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="referrer" content="never" />
		<link rel="stylesheet" href="../../../../css/mui.min.css">
		<link rel="stylesheet" href="../../static/css/common.css" />	
		<link rel="stylesheet" href="../../static/components/components.css" />	
		<link rel="stylesheet" href="../../static/css/terminalwork.css" />	
		<link href="../../../../css/mui.picker.css" rel="stylesheet" />
		<link href="../../../../css/mui.poppicker.css" rel="stylesheet" />
		<script src="../../../../js/mui.min.js"></script>
		<script src="../../../../js/vue.js"></script>
		<script type="text/javascript" src="../../../../js/jquery-3.2.1.min.js"></script>
		<script type="text/javascript" src="../../static/js/neiosRequst.js"></script>  <!--请求接口页面必需-->
		<script src="../../static/js/neiosCommon.js"></script>  <!--公共js页面必需-->
		<script src="../../static/components/selectitem.js"></script>  <!--填写说明组件-->
		<script src="../../static/js/upLoadHelper.js"></script>
	  <script src="../../../../js/mui.picker.js" type="text/javascript" charset="utf-8"></script>
	  <script src="../../../../js/mui.poppicker.js" type="text/javascript" charset="utf-8"></script>
	  <script src="../../../../js/mui.dtpicker.js"></script> 
		<style>
			.list-head{
				width: 94vw;
				margin-left: 3vw;
				background-color: #fff;
				padding: 10px;
				margin-bottom: 10px;
			}
			.additem{
				font-size: 6vw;
				font-style: initial;
				color: #004a86;
			}
		</style>
	</head>
	<body>
		<header class="mui-bar mui-bar-nav mui-bar-nav-bg">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 id="title" class="mui-title">工器具检查</h1>
		</header>
		<div class="mui-content" id="toolCheck">
			<div style="position: sticky;top: 50px;z-index: 11;" class="flex-between list-head">
				<div class="flex-row" style="font-weight: bold;">
					<div class="icon"></div>
					{{tableTitle}}
				</div>
				<button class="submit_btn" style="	margin: 0 !important;
					padding: 0 4vw !important;" @click="upToolCheckDialog('save')">新增</button>
			</div>
			<div id="terminalworkList" class="terminalwork-list">
				<div class="list" id="list">		
					<div v-for="(item,index) in neiosToolsCheckList" :key="index" class="terminalwork-list-item">
						<div class="terminalwork-list-title" @click="hideOperBtn()">工具名称：{{item.toolName}}</div>
						<div class="terminalwork-list-sec" @click="hideOperBtn()">
							<div>工具编号：{{item.toolCode}}</div>
							<div>检查时间：{{item.checkDate}}</div>
							<div v-if="item.toolType == null">工具类型：{{"["+item.nodeCreateStaffCode+"]"+item.nodeCreateStaffName}}</div>
							<div v-if="item.toolType == '01100'">工具类型：电动</div>
							<div v-if="item.toolType == '01101'">工具类型：绝缘</div>
						</div>
						<div class="terminalwork-list-receivebtn" onclick="showOperBtn(this)">操作</div>
						<div class="terminalwork-list-operbtn">
							<div class="terminalwork-list-operbtn-in">
								<div class="operbtn" @click="upToolCheckDialog('details',item.toolsCheckInfoId,item)">详情</div>
								<div class="operbtn" @click="upToolCheckDialog('update',item.toolsCheckInfoId,item,index)" 
								v-if="isShow">编辑</div>
								<div class="operbtn" @click="deleteToolsCheckInfo(item)">删除</div>
							</div>
						</div>
					</div>
				</div>	
			</div>
			<div class="flex-between fixed-bottom">
				<button class="submit_btn" v-show="isShow" @click="saveOrUpdateToolsCheck('save')">保存</button>
				<button class="submit_btn" v-show="isShow" @click="submitFnBtn('submit')">提交</button>
				<button class="submit_btn" @click="goBack">返回</button>
			</div>
			<div class="explain-dialog" v-if="troubleRecordAddVisible">
				<div class="explain-in">
					<div class="explain-header">本次任务缺陷隐患记录</div>
					<div class="explain-con">
						<div class="explain-con-title">本次任务缺陷隐患记录</div>
						<div style="margin:3vw 0 5vw">
							<div class="defect-info-list" v-for="item in questionArrary">
								<div class="neios-form-item">
									<div class="neios-form-item-lable" style="width:40%;">隐患描述:</div>
									<div class="neios-form-item-con" style="width:60%;">
										{{item.name}}
									</div>
								</div>
							</div>
						</div>
					</div>
					<div style="display:flex">
						<div class="explain-btn explain-btn-main" style="width:50%" @click="submitFn('submit')">确定</div>
						<div class="explain-btn" style="width:50%" @click="submitCancel()">取消</div>
					</div>
				</div>
			</div>
			<!-- 编辑表单 -->
			<div class="explain-dialog" v-if="toolCheckAddEditVisible">
				<div class="explain-in">
					<div class="explain-header">{{dialogTitle}}</div>
					<div class="explain-con">
						<div class="explain-con-title">工器具（电动、绝缘）检查记录</div>
						<div class="neios-form-item" style="margin:0 5vw;">
							<div class="neios-form-item-lable" style="width:40%;">工具类型 <span class="red">*</span></div>
							<div class="neios-form-item-con" style="width:60%;">
								<span v-for="item of toolType" style="display:flex;align-items:center;padding-right:5px;width:50%;float:left;">
									<input type="radio" name="toolType" :value="item.itemValue" 
									:disabled="isView" @change="toolTypeChange" :checked="neiosToolsCheckInfo.toolType == item.itemValue"/>
									<span style="padding-left:3px;">{{item.itemText}}</span>
								</span>
							</div>
						</div>
						<div class="neios-form-item" style="margin:0 5vw;">
							<div class="neios-form-item-lable" style="width:40%;">工具编号 <span class="red">*</span></div>
							<div class="neios-form-item-con" style="width:60%;">
								<selectitem placeholder="请输入" :onlyselect="onlyselect" type="TOOL" ref="selectitem"
								 @change="toolCodeChange()" :disabled="isView"></selectitem>
							</div>
						</div>
						<div class="neios-form-item" style="margin:0 5vw;">
							<div class="neios-form-item-lable" style="width:40%;">工具名称 <span class="red">*</span></div>
							<div class="neios-form-item-con" style="width:60%;">
								<input type="text" placeholder="请输入" name="toolName"
								v-model="neiosToolsCheckInfo.toolName" maxlength="30" :disabled="isView"
								@change="checkInput(neiosToolsCheckInfo.toolName,'toolName','0')"/>
							</div>
						</div>
						<div class="neios-form-item" style="margin:0 5vw;">
							<div class="neios-form-item-lable" style="width:40%;">存放位置 <span class="red">*</span></div>
							<div class="neios-form-item-con" style="width:60%;">
								<input type="text" placeholder="请输入" name="position"
								v-model="neiosToolsCheckInfo.position" maxlength="200" :disabled="isView"
								@change="checkInput(neiosToolsCheckInfo.position,'position','0')"/>
							</div>
						</div>
						<div class="neios-form-item" style="margin:0 5vw;">
							<div class="neios-form-item-lable" style="width:40%;">生产厂家 <span class="red">*</span></div>
							<div class="neios-form-item-con" style="width:60%;">
								<input type="text" placeholder="请输入" name="factory"
								v-model="neiosToolsCheckInfo.factory" maxlength="200" :disabled="isView"
								@change="checkInput(neiosToolsCheckInfo.factory,'factory','0')"/>
							</div>
						</div>
						<div class="neios-form-item" style="margin:0 5vw;">
							<div class="neios-form-item-lable" style="width:40%;">型号规格 <span class="red">*</span></div>
							<div class="neios-form-item-con" style="width:60%;">
								<input type="text" placeholder="请输入" name="typeSpecification"
								v-model="neiosToolsCheckInfo.typeSpecification" maxlength="30" :disabled="isView"
								@change="checkInput(neiosToolsCheckInfo.typeSpecification,'typeSpecification','0')"/>
							</div>
						</div>
						<div class="neios-form-item" style="margin:0 5vw;">
							<div class="neios-form-item-lable" style="width:40%;">检查日期 <span class="red">*</span></div>
							<div class="neios-form-item-con" style="width:60%;">
								<input type="text" placeholder="请输入" 
								v-model="neiosToolsCheckInfo.checkDate" maxlength="30" disabled />
							</div>
						</div>
						<div class="neios-form-item" style="margin:0 5vw;">
							<div class="neios-form-item-lable" style="width:40%;">下次检查日期 </div>
							<div class="neios-form-item-con" style="width:60%;">
								<input type="text" placeholder="请输入" 
								v-model="neiosToolsCheckInfo.nextCheckDate" maxlength="30" disabled />
							</div>
						</div>
						<div class="neios-form-item" style="margin:0 5vw;">
							<div class="neios-form-item-lable" style="width:40%;">周期 </div>
							<div class="neios-form-item-con" style="width:60%;display:flex;justify-content: space-between;">
								<!-- <div class="mui-numbox" data-numbox-min='0' data-numbox-max='100' style="height:30px;"> -->
								  <!-- <button class="mui-btn mui-numbox-btn-minus" type="button" style="height:30px;">-</button> -->
									<input type="number" maxlength="3" v-model="neiosToolsCheckInfo.cycleCount" 
									:disabled="isView" class="mui-numbox-input" @change="cycleCountChange()" style="height:30px;"/>
								  <!-- <button class="mui-btn mui-numbox-btn-plus" type="button" style="height:30px;">+</button> -->
								<!-- </div> -->
								<div @click="picker" style="position: relative;width:80px;margin-left:5px;">
								   <input type="text" readonly :value="cycleUnitChange(neiosToolsCheckInfo.cycleUnit)"/>
								</div>
							</div>
						</div>
						<div class="neios-form-item" style="margin:0 5vw;">
							<div class="neios-form-item-lable" style="width:40%;">检查人 <span class="red">*</span></div>
							<div class="neios-form-item-con" style="width:60%;">
								<input type="text" placeholder="请输入" 
								v-model="neiosToolsCheckInfo.checkStaffCodeName" disabled />
							</div>
						</div>
						<div class="neios-form-item" style="margin:0 5vw;" v-if="neiosToolsCheckInfo.toolType == '01101'">
							<div class="neios-form-item-lable" style="width:40%;">电压等级(kV) <span class="red">*</span></div>
							<div class="neios-form-item-con" style="width:60%;">
								<input type="text" placeholder="请输入" name="voltageClass"
								v-model="neiosToolsCheckInfo.voltageClass" maxlength="8" :disabled="isView" 
								@change="checkInput(neiosToolsCheckInfo.voltageClass,'voltageClass','0')"/>
							</div>
						</div>
						<div class="explain-con-title" v-on:click="addItem">检查项目列表<div class="additem" v-if="!isView">+</div></div>
						<div v-for="(listItem,index) in neiosToolsCheckInfo.neiosCheckItemNoteList">
							<div class="neios-form-item" style="margin:0 5vw;">
								<div class="neios-form-item-lable" style="width:40%;">检查项目 <span class="red">*</span></div>
								<div class="neios-form-item-con" style="width:60%;">
									<input type="text" placeholder="请输入" :name="'checkItemContent' + index"
									v-model="listItem.checkItemContent" maxlength="200"
									:disabled="listItem.lowerLevelChangeFlag == '0' || isView == true" 
									@change="checkList(index,'checkItemContent','0')"/>
								</div>
							</div>
							<div class="neios-form-item" style="margin:0 5vw;">
								<div class="neios-form-item-lable" style="width:40%;">检查要求 <span class="red">*</span></div>
								<div class="neios-form-item-con" style="width:60%;">
									<input type="text" placeholder="请输入" :name="'checkItemRequirement' + index"
									v-model="listItem.checkItemRequirement" maxlength="200" 
									:disabled="listItem.lowerLevelChangeFlag == '0' || isView == true"
									@change="checkList(index,'checkItemRequirement','0')" />
								</div>
							</div>
							<div class="neios-form-item" style="margin:0 5vw;">
								<div class="neios-form-item-lable" style="width:40%;">是否符合要求 <span class="red">*</span></div>
								<div class="neios-form-item-con" style="width:50%;">
									<span v-for="item of yesOrNo" style="display:flex;align-items:center;padding-right:5px;width:50%;float:left;">
										<input type="radio" :name="'yesOrNo' + index" :value="item.itemValue" 
										:disabled="isView == true" 
										@change="yesOrNoChange(index)" :checked="listItem.checkItemResult == item.itemValue"/>
										<span style="padding-left:3px;">{{item.itemText}}</span>
									</span>
								</div>
								<div v-if=" !isView && (listItem.isNewAdd == 'newAdd' || currentUser.stationNewCode == listItem.orgCode)" class="red" v-on:click="deleteItem(index)">删除</div>
							</div>
						</div>
						<div class="explain-con-title">检查结论</div>
						<div class="neios-form-item" style="margin:0 5vw;">
							<div class="neios-form-item-lable" style="width:40%;">结论 <span class="red">*</span></div>
							<div class="neios-form-item-con" style="width:60%;">
								<textarea type="text" placeholder="请输入结论" name="checkRemark"
								v-model="neiosToolsCheckInfo.checkRemark" maxlength="600" :disabled="isView"
								@change="checkInput(neiosToolsCheckInfo.checkRemark,'checkRemark','0')"></textarea>
							</div>
						</div>
						<div class="explain-con-title">
							<span>附件</span>
							<img class="upload-icon" src="../../static/uploadicon.png" v-on:click="chooesFile" v-if="!isView"/>
						</div>
						<div style="margin:3vw 5vw 0">
							<div class="nodata-tips" v-if="fileList.length == 0">暂无附件！</div>
							<div style="margin:3vw 0 5vw" v-else>
								<div class="neios-form-item" v-for="(item,i) in fileList">
									<div class="neios-form-item-lable" style="width:70%;text-align:left;">{{item.fileName}}</div>
									<div class="neios-form-item-con" style="width:30%;text-align:right;display: flex;justify-content:space-around">
										<div style="color:#004A86" v-on:click="downloadFile(item)">下载</div>
										<div style="color:#004A86" v-if="!isView" v-on:click="FileDelete(item)">删除</div>
									</div>
								</div>
							</div>
						</div>
					</div>
					<div style="display:flex">
						<div v-show="saveOrUpdate == 'save'" class="explain-btn explain-btn-main" style="flex-grow:1" @click="toolCheckSave">确认</div>
						<div v-show="saveOrUpdate == 'quickSave'" class="explain-btn explain-btn-main" style="flex-grow:1" @click="submit">提交</div> 
						<div v-show="saveOrUpdate == 'update'" class="explain-btn explain-btn-main" style="flex-grow:1" @click="toolCheckUpdate">修改</div> 
						<div class="explain-btn" style="flex-grow:1" @click="closeToolCheckAddEdit">取消</div> 
					</div>
				</div>
			</div>
		</div>
	</body>
	<script src="js/toolCheckAdd.js"></script>
</html>
